package newdecoupling.staffemp.controller;


import newdecoupling.staffemp.pojo.User;
import newdecoupling.staffemp.service.StaffEmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class StaffempController {

    @Autowired
    private StaffEmpService staffEmpService;

    @RequestMapping("/login")
    public List<User> getStaffEmp(@RequestParam(required = true) String  username,
                                  @RequestParam(required = true) String  password) {
//        return "Staff Emp";
        List<User> list = staffEmpService.findOne(username,password);
        return list;


    }


}
